//
//  YeeKindListHeaderView.m
//  YeeShopProject
//
//  Created by CoderYee on 2017/3/16.
//  Copyright © 2017年 CoderYee. All rights reserved.
//

#import "YeeKindListHeaderView.h"
#import "YeeButton.h"
@interface YeeKindListHeaderView ()
{
    
    NSMutableArray  *_buttonArray;
    
}
@end
@implementation YeeKindListHeaderView

-(instancetype)initWithFrame:(CGRect)frame
{
    
    if (self=[super initWithFrame:frame])
    {
        _buttonArray=[[NSMutableArray alloc] init];
        [self addOwnsView];
        [self bindViewModel];
    }
    
    return self;
}
-(void)addOwnsView
{
    _saleButton=[YeeButton buttonWithType:UIButtonTypeCustom];
    _complantButton=[YeeButton buttonWithType:UIButtonTypeCustom];
    _priceButton=[YeeButton buttonWithType:UIButtonTypeCustom];
    [_priceButton setImage:[UIImage imageNamed:@"jia"] forState:UIControlStateNormal];
    _priceButton.edgeInsetsStyle=YeeButtonEdgeInsetsStyleImageRight;
    _selectedButton=[YeeButton buttonWithType:UIButtonTypeCustom];
    [_buttonArray addObjectsFromArray:@[_saleButton,_complantButton,_priceButton,_selectedButton]];
    
    NSArray *titleArray=@[@"销量优先",@"评价数",@"价格",@"筛选"];

    CGFloat  width=kMainScreenWidth/4.0;
    for (NSInteger indexM=0; indexM<_buttonArray.count; indexM++)
    {
        UIButton  *btn=_buttonArray[indexM];
        btn.titleLabel.font=[UIFont Y_systemFontOfSize:15];
        [btn setTitleColor:kBlackColor forState:UIControlStateNormal];
        [btn setFrame:CGRectMake(width*indexM, 0, width, 35)];
        [btn setTitle:titleArray[indexM] forState:UIControlStateNormal];
        btn.centerY=self.centerY;
        [self addSubview:btn];
    }
    
}
#pragma mark 绑定ViewModel
-(void)bindViewModel
{
    
    
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
}
@end
